home *** CD-ROM | disk | FTP | other *** search
- var rowHeight = 0;
- var rowHeightRule = 0;
- var infoRule = -1;
-
- var CurrentExpandedElement = '[NONE]';
- var CurrentElementOrigWidth;
- var CurrentElementOrigZ;
- var CurrentElementClass;
- var CurrentElementBackground;
- var CurrentElementOrigLeft;
- var ExpandedListingClassName = 'expandedListing';
- var CurrentElementOrigBkgdColor;
- /* var computeStyle; */
- var ExpWidth;
- var ExpMargin;
-
- function ClearText(e) {
-
- /* move selection to a DIV that is moved off the visible screen area */
- /* then move selection back to the original element. */
- /* this forces any selected text to be unselected */
-
- document.getElementById('UnselectAll').select();
- e.focus();
- }
-
- function addEvent( obj, type, fn ) {
- if ( obj.attachEvent ) {
- obj["e"+type+fn] = fn;
- obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
- obj.attachEvent( "on"+type, obj[type+fn] );
- } else
- obj.addEventListener( type, fn, false );
- }
- function removeEvent( obj, type, fn ) {
- if ( obj.detachEvent ) {
- obj.detachEvent( "on"+type, obj[type+fn] );
- obj[type+fn] = null;
- } else
- obj.removeEventListener( type, fn, false );
- }
-
- function expandContract() {
- /* Expands/Contracts show listing */
-
- /* must assign this to Element for Firefox's sake */
- var Element = this;
-
- if (CurrentExpandedElement == Element) {
- /* return to original size */
- Element.className = CurrentElementClass;
- Element.style.marginLeft = CurrentElementOrigLeft;
- Element.style.width = CurrentElementOrigWidth;
- Element.style.backgroundColor = CurrentElementOrigBkgdColor;
- Element.style.zIndex = CurrentElementOrigZ;
-
- CurrentExpandedElement = '[NONE]';
- ClearText(Element);
- return;
- } else if (CurrentExpandedElement != '[NONE]') {
- /* return other element to original size before expanding this one */
- CurrentExpandedElement.className = CurrentElementClass;
- CurrentExpandedElement.style.marginLeft = CurrentElementOrigLeft;
- CurrentExpandedElement.style.width = CurrentElementOrigWidth;
- CurrentExpandedElement.style.backgroundColor = CurrentElementOrigBkgdColor;
- CurrentExpandedElement.style.zIndex = CurrentElementOrigZ;
- }
-
- /* expand this element */
- CurrentExpandedElement = Element;
- CurrentElementClass = Element.className;
- CurrentElementOrigLeft = Element.style.marginLeft;
- CurrentElementOrigWidth = Element.style.width;
- CurrentElementOrigZ = Element.style.zIndex;
- CurrentExpandedElement.style.backgroundColor = getStyle(Element,'background-color');
-
- Element.className = ExpandedListingClassName;
- Element.style.width = ExpWidth;/* '93%'; */
- Element.style.marginLeft = ExpMargin;/* '7%'; */
- Element.style.backgroundColor = CurrentElementOrigBkgdColor;
- ClearText(Element);
- }
-
- function makeSmaller(direction) {
-
- var selector;
- var infoSelector;
- var offset = 1;
- if (direction == '-') {
- offset = -1;
- }
-
- if (offset > 0) {
- if (infoRule < 0) {
- for (var i = 1; i <= 10000; i++) {
- infoSelector = document.styleSheets[0].rules[i];
- if (infoSelector.selectorText == '.INFO') {
- infoRule = i;
- i = 20000;
- }
- }
- } else {
- infoSelector = document.styleSheets[0].rules[infoRule];
- }
- }
-
- if (rowHeight < 1) {
- for (var r = 1; r <= 10000; r++) {
- selector = document.styleSheets[0].rules[r];
- if (selector.selectorText == '.guideRow') {
- rowHeight = parseInt(selector.style.height);
- rowHeightRule = r;
- r = 20000;
- }
- }
- } else {
- selector = document.styleSheets[0].rules[rowHeightRule];
- }
-
- rowHeight = rowHeight + offset;
- selector.style.height = rowHeight + 'px';
- if (offset > 0) {
- infoSelector.style.width = '100%';
- }
- }
-
- function ToggleVisibility() {
-
- var Element = document.getElementById('FIXED_DIV');
- var maxHeight = 40;
- var sourceLinks = document.getElementById('REMINDER_DIV');
- var DT = document.getElementById('DateTime');
- var currentHeight = parseInt(sourceLinks.scrollHeight);
-
- if (currentHeight < maxHeight) {
- /* no scroll bars visible, so nothing to do */
- return
- }
-
- /* dynamically copy the list of reminders to the new popup window */
- Element.innerHTML = sourceLinks.innerHTML;
-
- var remLabel = document.getElementById('REMINDER_LABEL');
-
- if(Element.style.visibility == 'visible') {
-
- Element.style.visibility = 'hidden';
- remLabel.title = 'click to expand reminders'; /* change the tooltip */
-
- } else {
-
- var oElement = Element;
- var borderHeight = 1;
-
- if(window.getComputedStyle) {
- Element.style.left = window.getComputedStyle(sourceLinks,null).left;
- borderHeight = parseInt(window.getComputedStyle(oElement,null).borderBottomWidth);
- } else if (oElement.currentStyle) {
- Element.style.left = sourceLinks.currentStyle.left;
- borderHeight = parseInt(oElement.currentStyle.borderBottomWidth);
- }
-
- Element.style.height = currentHeight + borderHeight;
- Element.style.visibility = 'visible';
- remLabel.title = 'click to hide reminders'; /* change the tooltip */
- }
- }
-
- function hideReminders() {
- document.getElementById('FIXED_DIV').style.visibility = 'hidden';
- }
-
- function getOuterHTML(obj){
-
- temp=document.getElementById(obj).cloneNode(true)
- document.getElementById('tempDiv').appendChild(temp)
- outer=document.getElementById('tempDiv').innerHTML
- document.getElementById('tempDiv').innerHTML=""
- return outer
-
- }
-
- /* alternative to hard-coding an onload statement in the body tag */
- /* this writes our custom reminder toggling function as a javascript link in the appropriate tag */
- /* doing everything this way allows the source HTML to remain completely generic other than the ID tags */
- /* document.getElementById('reminderLink').href = "javascript:ToggleVisibility()"; */
-
-
- function StartUp() {
-
- var allDivTags = document.getElementsByTagName('div');
-
- for (var i=0;i<allDivTags.length;i++) {
- if (allDivTags[i].className.substring(0,7) == 'listing') {
- addEvent(allDivTags[i],"dblclick",expandContract);
- }
- }
-
- GetExpandedCellSize();
- }
-
- function GetExpandedCellSize() {
- var ThisStyleSheet = document.styleSheets[1];
- var AllRules;
-
- if (ThisStyleSheet.cssRules) {
- /* firefox */
- AllRules = ThisStyleSheet.cssRules;
- } else {
- /* IE */
- AllRules = ThisStyleSheet.rules;
- }
- var NumRules = AllRules.length;
-
- for (i=NumRules-1;i >=0;i--) {
- if (AllRules[i].selectorText == '.expandedListing') {
- var thisRule = AllRules[i];
- ExpWidth = thisRule.style['width'];
- ExpMargin = thisRule.style['marginLeft'];
- i = -1;
- }
- }
- }
-
- function HideLoadingScreen() {
- var loadingScreen = document.getElementById('loading');
- loadingScreen.style.display = 'none';
- }
-
- function getStyle(oElm, strCssRule){
- /*
- Example call of the function:
- getStyle(document.getElementById("container"), "font-size");
- */
- var strValue = "";
- if(document.defaultView && document.defaultView.getComputedStyle){
- strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
- }
- else if(oElm.currentStyle){
- strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){
- return p1.toUpperCase();
- });
- strValue = oElm.currentStyle[strCssRule];
- }
- return strValue;
- }
-